package cc.vv.baselibrary.adapter

import cc.vv.baselibrary.adapter.holder.ExtendViewHolder
import com.chad.library.adapter.base.BaseQuickAdapter

/**
 * 公共适配器
 * @author Zml
 * @date 2018/7/20.
 */
abstract class SimpleCommonAdapter<T> : BaseQuickAdapter<T, ExtendViewHolder> {

    constructor(layoutResId: Int, data: List<T>?) : super(layoutResId, data)

    constructor(layoutResId: Int) : super(layoutResId)

    constructor(data: List<T>?) : super(data)

    override fun convert(helper: ExtendViewHolder, item: T) {
//        val view = helper.getView(R.id.item_divider_line)
//        if (view != null) {
//            if (helper.adapterPosition == (data.size - 1)) {
//                view.visibility = View.GONE
//            } else {
//                view.visibility = View.VISIBLE
//            }
//        }
        convert(helper, item, helper.adapterPosition)
    }

    public abstract fun convert(helper: ExtendViewHolder, item: T, position: Int)
}
